<?php
final class RecipientUtils {

    public static function extractRecipientName($recipient) {
        $recipientName;
        if (stripos($recipient, "(") == false) {
            $recipientName = null;
        } else {
            $recipientName = substr($recipient, 0, stripos($recipient, "("));
            $recipientName = trim($recipientName);
        }
        return $recipientName;
    }

    public static function extractRecipientNumber($recipient) {
        $recipientNumber;
        if (stripos($recipient, "(") == false) {
            $recipientNumber = trim($recipientNumber);
        } else {
            $recipientNumberTemp = substr($recipient, stripos($recipient, "("), strlen($recipient));
            $recipientNumberTemp = str_replace("(", " ", $recipientNumberTemp);
            $recipientNumberTemp = str_replace(")", " ", $recipientNumberTemp);
            $recipientNumber = $recipientNumberTemp;
        }
        return $recipientNumber;
    }

}
?>
